﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace WsdShop.IService
{
    public interface IBaseService<T> where T:class,new()
    {
        T LoadEntity(Expression<Func<T, bool>> whereLambda);

        List<T> LoadEntities(Expression<Func<T, bool>> whereLambda);

        int LoadEntitiesCount(Expression<Func<T, bool>> whereLambda);

        List<T> LoadPageEntities(int currentIndex, int pageSize, out int totalCount, Expression<Func<T, bool>> whereLambda, string order, bool isAsc);

        bool DeleteEntity(int Id);

        bool UpdateEntity(T entity);

        T AddEntity(T entity);
    }
}
